package com.sihan.framework.etm.dto;

import com.sihan.framework.etm.common.PageRequest;
import com.framework.util.lang.Regex;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import lombok.Data;
import lombok.EqualsAndHashCode;


@Data
@ApiModel("用户信息对象")
@EqualsAndHashCode(callSuper=false)
public class UserInfoDTO extends PageRequest implements Serializable {

  private static final long serialVersionUID = 1259791479847664119L;

  @Pattern(regexp = Regex.NAME, message = "{user.name}")
  @ApiModelProperty(value = "用户昵称")
  private String name;

  @ApiModelProperty(value = "用户名")
  private String username;

  @NotNull(message = "{user.sex}")
  @ApiModelProperty(value = "性别: true --> 男  false -->女")
  private Boolean sex;
  @ApiModelProperty(value = "角色")
  private String role;
  @ApiModelProperty(value = "编号")
  private String code;
  @ApiModelProperty(value = "角色id")
  private String roleId;
  @ApiModelProperty(value = "用户id")
  private String id;
  @ApiModelProperty(value = "用户id")
  private String userId;

  @Override
  public String toString() {
    return "昵称[" + name + "]、性别[" + (sex ? "男" : "女") + "]。";
  }
}
